package com.model.xmlElement.output;

import java.io.Serializable;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
 * *********************************************
 * @author Administrator
 * @FileName OutputFile.java
 * @DescriptionXML配置之输出文件配置
 **********************************************
 */
@XmlAccessorType(XmlAccessType.FIELD)
public class OutputFile implements Serializable{
	public static final Logger LOG = LoggerFactory.getLogger(OutputFile.class);
	private static final long serialVersionUID = 1L;
	
	@XmlElement(name = "output_file_separator")
	private String outputFileSeparator;								//文件分隔符
	
	@XmlElement(name = "user")
	private String user;											//设计抓取的用户
	
	@XmlElement(name = "output_local_file")
	private OutputFileLocal outputFileLocal;						//本地文件配置
	
	@XmlElement(name = "output_hdfs_file")
	private OutputFileHdfs outputFileHdfs;							//hdfs文件配置
	
	public void setOutputFileSeparator(String outputFileSeparator) {
		this.outputFileSeparator = outputFileSeparator;
	}

	public void setUser(String user) {
		this.user = user;
	}

	public OutputFileLocal getOutputFileLocal() {
		return outputFileLocal;
	}

	public void setOutputFileLocal(OutputFileLocal outputFileLocal) {
		this.outputFileLocal = outputFileLocal;
	}

	public OutputFileHdfs getOutputFileHdfs() {
		return outputFileHdfs;
	}

	public void setOutputFileHdfs(OutputFileHdfs outputFileHdfs) {
		this.outputFileHdfs = outputFileHdfs;
	}

	public OutputFile() {
		super();
	}
	/**
	 * 默认分隔符
	 * @return
	 */
	public String getOutputFileSeparator() {
		return (outputFileSeparator == null || outputFileSeparator.equals("")) ? "," : outputFileSeparator;
	}
	/**
	 * 默认用户
	 * @return
	 */
	public String getUser() {
		return (user == null || user.equals("")) ? "root" : user;
	}
}
